-
Notifications
You must be signed in to change notification settings - Fork 559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use xV_FROM_REF()
macros in place of casting result of SvRV()
#22417
Conversation
But, I noticed that the macro these call use a variable named |
... but only at file scope. |
If I'm wrong about this, please review "Choosing legal symbol names" in perlhacktips |
https://perldoc.perl.org/5.41.2/perlhacktips#Choosing-legal-symbol-names agrees with me:
|
I notice other macros use |
7fa858d
to
df05975
Compare
This results in shorter neater code, and additional debugging assertions that the dereferenced SVs really are the requested type when built under `-DDEBUGGING`. When I added the xV_FROM_REF() macros, I searched for `(TYPE)SvRV` style cast expressions, but forgot to additionally look for `MUTABLE_xV()` calls. There are additionally two spots in pp_hot.c that cannot be modified, because despite casting the result to a CV pointer, the SV isn't actually a CV. I've added a comment on these lines as to why they're not altered.
This results in shorter neater code, and additional debugging assertions that the dereferenced SVs really are the requested type when built under
-DDEBUGGING
.When I added the xV_FROM_REF() macros, I searched for
(TYPE)SvRV
style cast expressions, but forgot to additionally look forMUTABLE_xV()
calls.There are additionally two spots in pp_hot.c that cannot be modified, because despite casting the result to a CV pointer, the SV isn't actually a CV. I've added a comment on these lines as to why they're not altered.